<template>
	<view class="tongji-box">
		<view v-if="tongjiList.length==0" style="text-align: center;">
					<image src="../../static/nodata.png" class="nodata_img" ></image>
		</view>
		<uni-collapse>
			<uni-collapse-item class="biaoticolor" :title="iterm.yearMonths" v-for="(iterm,index) in tongjiList" :key="index">
								<view class="neirong" v-for="(itermm,indexx) in iterm.studentsFlyMsgPojos" :key="indexx" >
									<view class="neirong-top">
										<view class="xingming zhengwen2">{{itermm.name}}</view>
										<view class="xuehao zhengwen2"> 学号：{{itermm.sno}}</view>
										<view class="banji zhengwen2" style="flex: 11;">班级：{{itermm.className}}</view>
									</view>
									<view class="neirong-bottom">
										<view class="neirong-bottom-left">
											<view class="chichang zhengwen2">
												请假时间：（总时长{{ itermm.hours }}小时）
											</view>
											<view class="shijian zhengwen2">
												{{ itermm.beginTime }} 至 {{ itermm.endTime }}
											</view>
										</view>
										<view class="neirong-bottom-right">
											<view class="zhuangtai zhengwen2">
												<template v-if="itermm.status==1">请假中</template>
												<template v-if="itermm.status==2">已撤销</template>
												<template v-if="itermm.status==3">已销假</template>
												<template v-if="itermm.status==4" ><view style="color: red;">超时销假</view></template>
											</view>
										</view>
									</view>
								</view>
			</uni-collapse-item>
		</uni-collapse>
	</view>
</template>

<script>
	export default{
		props:["classId"],
		data(){
			return{
				tongjiList:[]
			}
			
		},
		created() {
			this.reloadRequest();
		},
		methods:{
			reloadRequest() {
				let _this = this;
				//提交数据请求接口
				uni.request({
					url: this.baseUrl + "/secretary/sum/searchStudentsByTime?satoken="+uni.getStorageSync('satoken'),
					data: {
						current: 1,
						size: 10,
						classId: this.$route.query.classId
					},
					withCredentials: true,
					headers: {
						//"content-type": "application/x-www-form-urlencoded",
						// token: localStorage.getItem('token')
					},
					success: res => { 
						console.log(res.data.data.vo);
						this.tongjiList=res.data.data.vo
					}
				}); 
			},
			
			tongjixiangqing(sno){
				uni.navigateTo({
					url: '/pages/tongjixiangqing/tongjixiangqing?sno='+sno
				});
			}
		}
		
		
	}
</script>

<style lang="scss">
	@import url(@/static/common.css);
	.tongji-box{
		width: 100%;
		overflow: hidden;
		box-sizing: border-box;
		.neirong{
			width: 95%;
			margin: 0 auto;
			display: flex;
			overflow: hidden;
			box-sizing: border-box;
			flex-direction: column;
			padding: 10rpx 0;
			border-bottom: 1rpx solid #999999;
			
			.neirong-top{
				display: flex;
				width: 100%;
				overflow: hidden;
				box-sizing: border-box;
				flex-direction: row;
				.xingming{
					flex: 3;
					
				}
				.xuehao{
					flex: 7;
				}
				.banji{
					flex: 7;
					text-align: right;
				}
				
			}
			.neirong-bottom{
				display: flex;
				width: 100%;
				overflow: hidden;
				box-sizing: border-box;
				flex-direction: row;
				margin-top: 10rpx;
				.neirong-bottom-left{
					flex: 3;
					overflow: hidden;
					box-sizing: border-box;
					flex-direction:column;
					justify-content: center;
					.shichang{
						flex: 1;
					}
					.shijian{
						flex: 1;
						letter-spacing: 1rpx;
						margin-top: 10rpx;
						
						
					}
				}
				.neirong-bottom-right{ 
					flex: 1;
					overflow: hidden;
					box-sizing: border-box;
					// justify-content: center;
					align-items: center;
					.zhuangtai{
						width: 80%;
						padding: 20rpx 0;
						text-align: center;
						// background-color: #f5f5f5;
					}
				}
				
			}
		}
		.neirong:last-child{
			border: none;
		}
		.biaoticolor{
			/deep/ .uni-collapse-item__title-box{
				background-color: #f5f5f5;
			}
			/deep/ .uni-collapse-item__title{
				background-color: #f5f5f5;
			}
			/deep/ .uni-collapse-item__title-text{
				color: #444444;
				font-size: 36rpx;
			}
			
		}
		
		
	}
	.tongji-box{
		/dedp/ .uni-collapse-item__wrap-content .uni-collapse-item--border{
			border-bottom: none;
		}	
	}
</style>